<template>
	<div id="my_note">
		<div class="nav">
			<ul class="am-avg-sm-4">
				<li><a @click="uni.redirectTo({
						url:'trip_comment'
					})">游记评论</a></li>
				<li><a @click="uni.redirectTo({
						url:'my_project_comment'
					})">活动评论</a></li>
				<li><a @click="uni.redirectTo({
						url:'check'
					})">游记待审核</a></li>
				<li><a class="cur" @click="uni.redirectTo({
						url:''
					})">审核不通过</a></li>
			</ul>
		</div>
		<div id="app">
			<div class="cont">
				<ul v-for="b in articles">
					<li>
						<div class="box_cont">
							<a title="" @click="itemClicked(b)">
								<div class="pic">
									<img :src="'https://yo.docshare.org.cn'+b.head_photo">
								</div>
								<div class="project_cont">
									<p>{{b.articletitle}}</p>
								</div>
								<div class="clear"></div>
								{{b.articletime}}
							</a>
						</div>
						<span class="date">{{b.articletitle_comment}}</span>
						<div class="button">
							<input type="submit" class="input" @click="delete1(b)" value="删除" />
						</div>
					</li>
				</ul>
				<div id="none">
					没有更多了
				</div>
			</div>
		</div>
	</div>
</template>

<script>
	import config from '@/config'
	
	export default {
		components:{
			
		},
		data() {
			return {
				uni,
				aid: '',
				articles: {},
				id: '',
			}
		},
		methods: {
			itemClicked: function(item) {
				this.id = item.id;
			},
			delete1: function(item) {
				this.id = item.id;
				uni.request({
					url: `${config.baseUrl}/article/deletenopass?token=` + uni.getStorageSync('token'),
					method: 'POST',
					data:{
						'id': this.id,
					},
					success(r) {
						if (r.data.succ) {
							
						} else {
						
						}
					},
					complete(res){
						if(res.data && res.data.msg){
							uni.showToast({
								icon:'none',
								title:res.data.msg
							})
						}
					},
				});
			},
		},
		onLoad() {
			var that = this;
			uni.request({
				url: `${config.baseUrl}/article/nopass?token=` + uni.getStorageSync('token'),
				method: 'GET',
				success(r) {
					if (r.data.succ) {
						that.articles = r.data.data;
					} else {

					}
				},
					complete(res){
						if(res.data && res.data.msg){
							uni.showToast({
								icon:'none',
								title:res.data.msg
							})
						}
					},
			});
		}
	}
</script>

<style>
</style>
